-
Notifications
You must be signed in to change notification settings - Fork 11
refactor: CSS "condition" to SCSS condition #4690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔭🐙🐈 Test this branch here: https://db-ux-design-system.github.io/core-web/review/refactor-css-condition-to-scss-condition |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This refactoring moves CSS element type checking from runtime CSS :is()
selectors to build-time SCSS conditions, improving maintainability and performance by reducing CSS complexity. The change replaces CSS pseudo-selectors with SCSS conditional compilation.
- Replaced CSS
:is(input, textarea)
selectors with SCSS@if
conditions usinglist.index()
- Added SCSS variables to define valid form field types for read-only and field-sizing properties
- Updated CSS variable naming to be dynamic based on the element type
Proposed changes
Currently we've checked for the elements to be either
input
ortextarea
at the CSS level with:is()
. Instead as we're using those in a SCSS mixin, we should that for check for those element types in a SCSS condition.The main purpose of this is to prevent resulting selectors like
.db-input input:is(input,textarea):not(:disabled):read-only
, which becomes.db-input input:not(:disabled):read-only
Types of changes
Further comments